About Core Printing Features
Core printing features are features that must be implemented to allow printing documents that contain QuickDraw GX graphics or typographical shapes. These features include the ability to print to desktop printers, format a document for a particular printer (a formatting printer), yet allow printing to another printer (the output printer) without reformatting the document. Core features also include the ability to print from the Finder and to print existing documents designed for printing with the Macintosh Printing Manager.To enable these core features, your application must manipulate three kinds of objects:
Figure 2-1 shows the relationship between these objects.
- the job object, which contains information about the print job used to print a document
- the format object, which contains information about how to format one or more pages of a document for printing
- the paper-type object, which contains information about the paper on which a document is to be printed
Figure 2-1 Objects needed to implement core printing features
All aspects of printing with QuickDraw GX relate to a particular job object. The job object defines the parameters with which to print the document, which a user typically specifies in the Print dialog box.
Your application sets up the correspondence between a document and a job object. The job object is tied to the format and paper-type objects through references. A job object refers to at least one format object. The format object specifies how to format the pages in a document. To implement core printing features, in which each page of a document is formatted the same way, you are only concerned about the first reference to a format object because this format object represents the default format.
Each format object refers to a paper-type object. Thus, it is actually this pair of objects that specifies how the pages of a document are formatted. The user typically specifies the format options, which translate into format object properties and specifies paper-type options, which translate into paper-type object properties, in the Page Setup Dialog box.
These three objects--the job, format, and paper-type--can refer to other objects, some of which are collections of additional specifications. These other objects and specifications are not required, however, to implement the core printing features.
The references themselves are properties of the job, format, or paper-type objects. The references are mentioned in the following section, which describes each object's properties. The other objects themselves, however, are described as they are used in the chapters "Page Formatting and Dialog Box Customization" and "Advanced Printing Features" in this book.
In addition to manipulating job, format, and paper-type objects, your application must also initialize the printing environment, handle printing-related errors, and handle two situations that can arise when the user invokes a print dialog box:
Your application should also handle printing from the Finder, which occurs when the user chooses Print from the Finder's File menu or drags a document onto a desktop printer icon. Finally, your application can also handle printing of existing documents designed for printing with the Macintosh Printing Manager.
- Your application must let QuickDraw GX know which Edit menu items are to be enabled when a QuickDraw GX dialog box is active. Although QuickDraw GX implements the Cut, Copy, Paste, and Clear menu items for you, you must specify which of these items are enabled. If other menu items are enabled, such as Undo, you must also handle the item as well as enable it.
- Your application must respond to printing event messages, which allows updating the screen when the user moves a dialog box. Printing event messages and movable dialog boxes are described in the chapter "Introduction to Printing With QuickDraw GX" in this book.
The following section, "Core Print Objects," describes the QuickDraw GX objects needed to implement core printing features. The section "Using Core Printing Features" beginning on page 2-10 provides examples of code that implements these core features.
Subtopics
- Core Print Objects
- Edit Menu Structure
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help